package com.xoa.controller.party;


import com.xoa.model.party.EnSafetyRegulation;
import com.xoa.service.party.EnSafetyRegulationService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 安全政策法规
 * Created by gsb on 2018/1/10.
 */
@Controller
@RequestMapping("/enSafetyRegulation")
public class EnSafetyRegulationController {

    @Resource
    private EnSafetyRegulationService enSafetyRegulationService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 下午14:40:51
     * 类介绍  :   查找登陆人的信息
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryUser")
    @ResponseBody
    public ToJson<EnSafetyRegulation> queryUser(HttpServletRequest request){
        return enSafetyRegulationService.queryUser(request);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 下午14:46:51
     * 类介绍  :   新建
     * 构造参数:
     *
     */
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EnSafetyRegulation> insertSelective(EnSafetyRegulation enSafetyRegulation, HttpServletRequest request){
        return enSafetyRegulationService.insertSelective(enSafetyRegulation,request);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 下午14:46:51
     * 类介绍  :   删除
     * 构造参数:
     *
     */
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EnSafetyRegulation> deleteByPrimaryKey(Integer rid){
        return enSafetyRegulationService.deleteByPrimaryKey(rid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 下午14:46:51
     * 类介绍  :   修改
     * 构造参数:
     *
     */
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EnSafetyRegulation> updateByPrimaryKeySelective(EnSafetyRegulation enSafetyRegulation){
        return enSafetyRegulationService.updateByPrimaryKeySelective(enSafetyRegulation);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 下午14:46:51
     * 类介绍  :   详情
     * 构造参数:
     *
     */
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EnSafetyRegulation> selectById(Integer rid, HttpServletRequest request) {
        return enSafetyRegulationService.selectById(rid,request);
    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-10 下午15:16:51
     * 类介绍  :   列表
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EnSafetyRegulation> queryList(EnSafetyRegulation enSafetyRegulation, Integer page, Integer pageSize,
                                                boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return enSafetyRegulationService.queryList(enSafetyRegulation, page, pageSize, useFlag, request, response, export);
    }
}
